CC=g++
DEBUG=
CFLAGS=-c $(DEBUG)
LDFLAGS=-lncursesw $(DEBUG)



debug: clean
debug: DEBUG +=-g
debug: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(OBJECTS) $(LDFLAGS) -o $@

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

Czar: main.cpp Card.o Deck.o Logic.o Player.o Table.o
	g++ main.cpp Card.o Deck.o Logic.o Player.o Table.o -o Czar
Card.o: Card.cpp Card.h
	g++ -c Card.cpp
Deck.o: Deck.cpp Deck.h Card.o
	g++ -c Deck.cpp
Logic.o: Logic.cpp Logic.h Deck.o
	g++ -c Logic.cpp
Player.o: Player.cpp Player.h
	g++ -c Player.cpp
Table.o: Table.cpp Table.h
	g++ -c Table.cpp
card_test: tests/card_test.cpp Card.o
	g++ tests/card_test.cpp Card.o -o card_test
deck_test:tests/deck_test.cpp Deck.o Card.o
	g++ tests/deck_test.cpp Deck.o Card.o -o deck_test
logic_test:tests/table_test.cpp Logic.o Deck.o Card.o Player.o
	g++ tests/logic_test.cpp Logic.o Deck.o Card.o Player.o -o logic_test
table_test:tests/table_test.cpp Table.o Player.o Deck.o Card.o
	g++ tests/table_test.cpp Table.o Player.o Card.o Deck.o -o table_test

Client.o: Client.cpp display.cpp display.h
	g++ -c display.cpp -o display.o
	g++ -c Client.cpp -o Client.o
	g++ display.o Client.o -lncursesw -o Client

clean:
	-rm Card.o
	-rm Deck.o
	-rm Logic.o
	-rm Player.o
	-rm Table.o
	-rm Client.o
	-rm card_test
	-rm deck_test
	-rm logic_test
	-rm table_test
	-rm Czar
	-rm client
